include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/kernel.mk

PKG_NAME:=demo_cmake
PKG_VERSION:=2016.04.11

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

TARGET_CFLAGS += -DAT_PLATFORM_$(PROFILE)
TARGET_CFLAGS += -DPORDUCT_BRAND=$(PORDUCT_BRAND) 

define Package/$(PKG_NAME)
   SECTION:=hos
   CATEGORY:=hos
   SUBMENU:=apps
   TITLE:= This is a debug app.
endef

define Build/Prepare
	rm -rf $(PKG_BUILD_DIR)
	mkdir -p $(PKG_BUILD_DIR)
	$(CP) ./src/* $(PKG_BUILD_DIR)/
endef

define Package/$(PKG_NAME)/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/partool $(1)/usr/bin/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/productinfo $(1)/usr/bin/
endef

$(eval $(call BuildPackage,$(PKG_NAME)))
